package com.yhb.channel.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.yhb.channel.model.IBankCard;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class BankCard implements IBankCard {
    public enum Type {
        CREDIT,
        DEBIT
    }
    String id;
    String userId;
    String number;
    String phoneNumber;
    private Type type;
    String cvv2;
    String validation;
    String province;
    String city;
    String district;
    String bankName;
    String subBankName;
    String bankCardImgUrl;

    @JsonIgnore
    @Override
    public int getCardType() {
        if (this.type == Type.DEBIT) return 0;
        return 1;
    }
}
